# Maintainer: Kaarle Ritvanen <kunkku@alpinelinux.org>
pkgname=alpine
pkgver=2.26
pkgrel=2
pkgdesc="Text-based email client, friendly for novices but powerful"
url="https://repo.or.cz/alpine.git"
arch="all"
license="Apache-2.0"
makedepends="openldap-dev heimdal-dev ncurses-dev openssl-dev>3"
subpackages="$pkgname-dbg $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://repo.or.cz/alpine.git/snapshot/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

# secfixes:
#   2.25-r0:
#     - CVE-2021-38370
#   2.23-r0:
#     - CVE-2020-14929

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-passfile=.pine-pass \
		--without-tcl \
		--disable-shared \
		--with-system-pinerc=/etc/alpine.d/pine.conf \
		--with-system-fixed-pinerc=/etc/alpine.d/pine.conf.fixed
	make -j1
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
7ca4d5fc7cc9b5fc63b0cb341fa161274c7f724d3f812a7f94dcfe60d678665f0fbce5b671fa26d4da822f09ac58978a3f6385a94c8f3dc9b16bd8fa66a49634  alpine-2.26.tar.gz
"
